// GFX/Visual.h

#ifndef _GFX_Visual_H_
#define _GFX_Visual_H_

#ifndef _CORE_std_H_
#include <core/std.h>
#endif

#ifndef _GFX_Frame_H_
#include <gfx/Frame.h>
#endif

namespace GFX
{
class Visual
{
public:

	enum eTextureMode
	{
		kNormal = 0,
		kAtlas,
		kTotalMode,
	};

	typedef struct _AtlasInfo
	{
		const _AtlasInfo & operator=(const _AtlasInfo & that)
		{
			for (int i=0; i < kTotalCorner; ++i)
				points[i] = that.points[i];

			return (*this);
		}

		Math::vec2	points[kTotalCorner];
	}AtlasInfo;

public:
	Visual() : m_TextureMode(kNormal) {}
	virtual	~Visual() {; };

	virtual TypeId			GetTypeId() = 0;
	static TypeId			StaticTypeId() {
		return s_TypeId;
	}

	// Acessors
	Frame &					GetFrame() {
		return m_Frame;
	}
	const Frame &			GetFrame() const {
		return m_Frame;
	}

	Math::vec3				GetPosition() const {
		return m_Frame.GetLocalPosition();
	}
	void					SetPosition(const Math::vec3 & vPos) {
		return m_Frame.SetLocalPosition(vPos);
	}

	eTextureMode			GetTextureMode() {
		return m_TextureMode;
	}
	const eTextureMode		GetTextureMode() const {
		return m_TextureMode;
	}

	// APIs

protected:
	static TypeId	s_TypeId;

	Frame			m_Frame;
	eTextureMode	m_TextureMode;
};

}; // namespace GFX

#endif